package cate.common.table.activity.cutstone.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.cutstone.row.CutTaskRow;

import java.util.ArrayList;
import java.util.List;

public class CutTaskSheet extends ESheet<CutTaskRow> {
    @Override
    public String getSheetName() {
        return "任务";
    }

    /**
     * 根据任务类型获取任务
     */
    public List<Integer> getTaskIds(int configId, byte type) {
        List<Integer> taskIds = new ArrayList<>();
        for (CutTaskRow row : this.getList()) {
            if (row.configId == configId && row.type == type) {
                taskIds.add(row.taskId);
            }
        }
        return taskIds;
    }

    public List<Integer> getTaskIds(int configId) {
        List<Integer> taskIds = new ArrayList<>();
        for (CutTaskRow row : this.getList()) {
            if (row.configId == configId) {
                taskIds.add(row.taskId);
            }
        }
        return taskIds;
    }

}
